<% (display-partial "doctype") %>
<head>
	<% (display-partial "header") %>
</head>

<body>

<div id="wrap">
	<div id="header">
		<% (display-partial "navigation") %>	
		<div class="clear"></div>
	</div>

	<div id="content">
				
		<div class="title nomargin">
			<p><% (title "| Dragonfly web framework") %><p>
		</div>
		
		<h1>Locating Self</h1>
		<p class="extract">
			There was a young man who said, "Though it seems that I know that I know, what I would like to see is the 'I' that knows 'me', when I <span style="font-style:normal">know</span> that I know that I know." -- Alan Watts
		</p>
		<p>
			The <span class="code">SET_DF_SELF</span> function sets the <span class="code">DF_SELF</span> and <span class="code">DF_SELF_DIR</span> global symbols. As described in the section on <%(link_to "creating your own routes" "dragonfly_create_routes")%>, it is the responsibility of the route to call this function and therefore, if the route fails to perform this duty, these two symbols will be <span class="code">nil</span>.
		</p>
		<p>
			All other symbols listed here are guaranteed to be set to their proper values, and all of the routes that come with Dragonfly call <span class="code">SET_DF_SELF</span>.
		</p>
		<h3 class="param">DF_SELF</h3>
		<p>
			This symbol contains the absolute path (on the server) to the main file responsible for providing an response to the requested URL, for example:
		</p>
		<p>
			<span class="code">/home/www/rundragonfly.com/views/locating_self.html</span>
		</p>
		<h3 class="param">DF_SELF_DIR</h3>
		<p>
			Contains the absolute path to the (on the server) to the directory containing the file represented
			by <span class="code">DF_SELF</span>. This is a handy symbol, often used by scripts in combination with
			the <span class="code">add-to-load-path</span> function (see <%(link_to "the Core API" "dragonfly_api")%> for more info).
		</p>
		<h3 class="param">DF_PAGE</h3>
		<p>
			<span class="code">DF_PAGE</span> is useful when writing <%(link_to "templates" "dragonfly_templates")%>,
			it tells us the full resource portion of the URL. For example, here's it current value:
		</p>
		<p><span class="code"><%=DF_PAGE%></span></p>
		
		
		<% (display-partial "continue") %>
		
		<div class="line-dotted"></div>

		<% (benchmark-result) %>
		
		<div class="line-dotted"></div>
		
		
	</div><!-- END CONTENT -->
	
</div><!-- END WRAP -->
<% (display-partial "footer") %>

